﻿var toastrHelper = {
    toastOptions: {
        //"closeButton": true,
        "debug": false,
        "positionClass": "toast-bottom-right",
        "onclick": null,
        "showDuration": "600",
        "hideDuration": "1000",
        "timeOut": "5000",
        "extendedTimeOut": "1000",
        "showEasing": "swing",
        "hideEasing": "linear",
        "showMethod": "fadeIn",
        "hideMethod": "fadeOut"
    },
    success: function (title, message) {
        toastr.options = this.toastOptions;
        toastr.success(title, message);
    },
    defaultError: function () {
        toastr.options = this.toastOptions;
        toastr.error('خطا', 'عملیات با شکست مواجه شد');
    },
    defaultSuccess: function(){
        toastr.options = this.toastOptions;
        toastr.success('پیام', 'عملیات با موفقیت انجام شد');
    },
    error: function (title, message) {
        toastr.options = this.toastOptions;
        toastr.error(title, message);
    },
    info: function (title, message) {
        toastr.options = this.toastOptions;
        toastr.info(title, message);
    },
    warning: function (title, message) {
        toastr.options = this.toastOptions;
        toastr.warning(title, message);
    }
};